package com.atguigu.biliplayer.utils;

import android.graphics.Bitmap;

import com.atguigu.biliplayer.R;
import com.nostra13.universalimageloader.core.DisplayImageOptions;

/**
 * 图片加载器的属性管理器
 * Created by 刘晨龙 on 2015/11/5.
 */
public class ImageLoaderOptions {
    private static DisplayImageOptions options;

    private static void genericDefaultOptions() {
        options = new DisplayImageOptions.Builder()
                .bitmapConfig(Bitmap.Config.RGB_565)
                .cacheInMemory(true)
                .cacheOnDisk(true)
                .showImageOnLoading(R.mipmap.ic_launcher)
                .build();
    }

    public DisplayImageOptions getDefaultOptions() {
        if (options == null) {
            genericDefaultOptions();
        }
        return options;
    }
}
